import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isFirstCome:true,
    college:JSON.parse(sessionStorage.getItem('college'))
  },
  mutations: {
    //set
    SET_ISFIRSTCOME: (state, isFirstCome) => {
      state.isFirstCome = isFirstCome
    },
    SET_COLLEGE: (state, college) => {
      state.college = college
      sessionStorage.setItem("college",JSON.stringify(college))
    },
    //remove
    REMOVE: (state) => {
      state.college = ''
      sessionStorage.removeItem('college')
    }
  },
  getters:{
    //get
    GET_ISFIRSTCOME: state => {
      return state.isFirstCome
    },
    GET_COLLEGE: state => {
      return state.college
    }
  },
  actions: {
  },
  modules: {
  }
})
